#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
	int a, b;
	cin >> a >> b;

	int cnt = 0, sum = 0;
	for (int i = a; i <= b; i++) {
		cout << setw(5) << i << (++cnt % 5 ? "" : "\n");
		sum += i;
	}
	cout << ((b - a + 1) % 5 ? "\n" : "") << "Sum = " << sum;
	return 0;
}
